Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageBus restructure #162

Draft
wants to merge 49 commits into
base: master
Choose a base branch
from
Draft

Conversation

ChiTimesChi
Copy link
Collaborator

Description

Replaces #158 #161

This PR aims to provide an immutable MessageBus, which is supposed to serve as a backbone for the messaging infra on all the chains. All potential upgradeable logic is separated into separate contracts:

  • AuthVerifier is responsible for verifying the submitted messages, which can be later upgraded to verifying messages using a submitted proof.
  • MessageExecutor is responsible for executing messages of any types, as well as for calculating the fees for doing so from a remote chain.

MessageBus is responsible for:

  • Sending messages:
    • Applying correct fee from MessageExecutor.
    • Emitting events, indicating that message was sent.
  • Receiving messages:
    • Checking that every message can be executed only once.
    • Checking that message sender is authenticated by AuthVerifier.
    • Passing message correctly to have it executed by MessageExecutor.

Checklist

  • New Contracts have been tested
  • Lint has been run
  • I have checked my code and corrected any misspellings

- variable names should be more clear now
- enforced alfabetical order of variables to avoid confusion
- docs on the srtucts are more verbose
- tests are updated to reflect the these changes
This was referenced May 27, 2022
@coveralls
Copy link

coveralls commented May 27, 2022

Pull Request Test Coverage Report for Build 2398388162

  • 0 of 190 (0.0%) changed or added relevant lines in 10 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-2.1%) to 24.744%

Changes Missing Coverage Covered Lines Changed/Added Lines %
contracts/messaging/ContextChainId.sol 0 2 0.0%
contracts/messaging/HarmonyMessageBus.sol 0 2 0.0%
contracts/messaging/libraries/Bytes32AddressLib.sol 0 2 0.0%
contracts/messaging/MessageBus.sol 0 9 0.0%
contracts/messaging/libraries/OptionsLib.sol 0 9 0.0%
contracts/messaging/libraries/PricingUpdateLib.sol 0 11 0.0%
contracts/messaging/framework/SynMessagingReceiverUpgradeable.sol 0 14 0.0%
contracts/messaging/MessageBusReceiver.sol 0 16 0.0%
contracts/messaging/MessageBusSender.sol 0 19 0.0%
contracts/messaging/MessageExecutorUpgradeable.sol 0 106 0.0%
Totals Coverage Status
Change from base Build 2386183733: -2.1%
Covered Lines: 664
Relevant Lines: 2474

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants